import type { AddressItem } from "@/types/address"
import type { ProfileDetail, ProfileParams } from "@/types/member"
import { http } from "@/utils/http"
// 获取个人信息
export const getMemberProfile = () => {
  return http<ProfileDetail>({
    method: 'GET',
    url: '/member/profile',
  })
}

// 修改个人信息
export const putMemberProfile = (data: ProfileParams) => {
  return http<ProfileDetail>({
    method: 'PUT',
    url: '/member/profile',
    data,
  })
}

// 获取收货地址详情
export const getMemberAddressById = (id: string) => {
  return http<AddressItem>({
    method: 'GET',
    url: `/member/address/${id}`,
  })
}
